"""
    完成获在【门店管理】下新增门店业务层实现
"""

import unittest
import json
from parameterized import parameterized
from api.apiCreateStore import ApiCreateStore
from tools.readJson import ReadJson
from tools.log import LogPrint
from config.conf import ConfigYaml


def get_data():
    data = ReadJson("token.json").read_json()
    arrs = []
    arrs.append((ConfigYaml().get_conf_url() + "/apiHost/api/agent/shop/v1/add",
                 "bearer " + data.get("accessToken")))
    return arrs


class TestCaseCreateStore(unittest.TestCase):
    @parameterized.expand(get_data())
    def test_create_store(self, url, token):
        # url = ConfigYaml().get_conf_url() + '/apiHost/api/agent/shop/v1/add'

        s = ApiCreateStore().api_create_store(url=url, token=token)

        print(s.json())

        # 打个日志
        LogPrint().logsinfo(s.json())
        self.assertEqual('200', s.json()['code'])
        return json.dumps(s.json()['data'])



# if __name__ == '__main__':
#     unittest.main()
